<template>
  <!-- 删除对话框 -->
  <div class="delModal">
    <a-modal :title="title" :visible="visible" :confirm-loading="loading" @change="_change" @ok="_ok" @cancel="_cancel">
      <p class="delModal-content"><a-icon class="delModal-content-icon" type="warning" />{{ msg }}</p>
    </a-modal>
  </div>
</template>
<script>
export default {
  props: {
    msg: {
      type: String,
      default: '您确定要执行删除操作吗？'
    },
    title: { type: String, default: '删除' },
    visible: {
      type: Boolean,
      default: false,
      require: true
    },
    loading: {
      type: Boolean,
      default: false
    }
  },
  model: {
    prop: 'visible',
    event: 'change'
  },
  methods: {
    _change(e) {
      console.log(e)
    },
    _ok() {
      this.$emit('ok')
    },
    _cancel() {
      this.$emit('cancel')
    }
  }
}
</script>
<style lang="less" scoped>
.delModal {
  &-content {
    text-align: center;
    display: flex;
    text-align: center;
    align-items: center;
    justify-content: center;
    &-icon {
      font-size: 40px;
      margin-right: 30px;
      color: #f2a654;
    }
  }
}
</style>
